home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / Programming / MPW Interfaces & Libraries 3.1 / CIncludes / Menus.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-10-13  |  5.0 KB  |  175 lines  |  [TEXT/MPS ]

  1. /************************************************************
  2.  
  3. Created: Wednesday, September 13, 1989 at 6:02 PM
  4.     Menus.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.     Copyright Apple Computer, Inc.    1985-1989
  9.     All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __MENUS__
  15. #define __MENUS__
  16.  
  17. #ifndef __QUICKDRAW__
  18. #include <Quickdraw.h>
  19. #endif
  20.  
  21. #define noMark '\0'         /*mark symbol for MarkItem*/
  22.  
  23. /* menu defProc messages */
  24.  
  25. #define mDrawMsg 0
  26. #define mChooseMsg 1
  27. #define mSizeMsg 2
  28. #define textMenuProc 0
  29. #define hMenuCmd 27         /*itemCmd == 0x001B ==> hierarchical menu*/
  30. #define hierMenu -1         /*a hierarchical menu - for InsertMenu call*/
  31. #define mPopUpMsg 3         /*menu defProc messages - place yourself*/
  32. #define mctAllItems -98     /*search for all Items for the given ID*/
  33. #define mctLastIDIndic -99    /*last color table entry has this in ID field*/
  34.  
  35. struct MenuInfo {
  36.     short menuID;
  37.     short menuWidth;
  38.     short menuHeight;
  39.     Handle menuProc;
  40.     long enableFlags;
  41.     Str255 menuData;
  42. };
  43.  
  44. typedef struct MenuInfo MenuInfo;
  45. typedef MenuInfo *MenuPtr, **MenuHandle;
  46.  
  47. struct MCEntry {
  48.     short mctID;            /*menu ID.    ID = 0 is the menu bar*/
  49.     short mctItem;            /*menu Item. Item = 0 is a title*/
  50.     RGBColor mctRGB1;        /*usage depends on ID and Item*/
  51.     RGBColor mctRGB2;        /*usage depends on ID and Item*/
  52.     RGBColor mctRGB3;        /*usage depends on ID and Item*/
  53.     RGBColor mctRGB4;        /*usage depends on ID and Item*/
  54.     short mctReserved;        /*reserved for internal use*/
  55. };
  56.  
  57. typedef struct MCEntry MCEntry;
  58. typedef MCEntry *MCEntryPtr;
  59.  
  60. typedef MCEntry MCTable[1], *MCTablePtr, **MCTableHandle;
  61.  
  62. struct MenuCRsrc {
  63.     short numEntries;        /*number of entries*/
  64.     MCEntry data[1];        /*ARRAY [1..numEntries] of MCEntry*/
  65. };
  66.  
  67. typedef struct MenuCRsrc MenuCRsrc;
  68. typedef MenuCRsrc *MenuCRsrcPtr, **MenuCRsrcHandle;
  69.  
  70. #ifdef __cplusplus
  71. extern "C" {
  72. #endif
  73. pascal void InitMenus(void)
  74.     = 0xA930;
  75. pascal MenuHandle NewMenu(short menuID,const Str255 menuTitle)
  76.     = 0xA931;
  77. pascal MenuHandle GetMenu(short resourceID)
  78.     = 0xA9BF;
  79. pascal void DisposeMenu(MenuHandle theMenu)
  80.     = 0xA932;
  81. pascal void AppendMenu(MenuHandle menu,const Str255 data)
  82.     = 0xA933;
  83. pascal void AddResMenu(MenuHandle theMenu,ResType theType)
  84.     = 0xA94D;
  85. pascal void InsertResMenu(MenuHandle theMenu,ResType theType,short afterItem)
  86.     = 0xA951;
  87. pascal void InsertMenu(MenuHandle theMenu,short beforeID)
  88.     = 0xA935;
  89. pascal void DrawMenuBar(void)
  90.     = 0xA937;
  91. pascal void DeleteMenu(short menuID)
  92.     = 0xA936;
  93. pascal void ClearMenuBar(void)
  94.     = 0xA934;
  95. pascal Handle GetNewMBar(short menuBarID)
  96.     = 0xA9C0;
  97. pascal Handle GetMenuBar(void)
  98.     = 0xA93B;
  99. pascal void SetMenuBar(Handle menuList)
  100.     = 0xA93C;
  101. pascal void InsMenuItem(MenuHandle theMenu,const Str255 itemString,short afterItem)
  102.     = 0xA826;
  103. pascal void DelMenuItem(MenuHandle theMenu,short item)
  104.     = 0xA952;
  105. pascal long MenuKey(short ch)
  106.     = 0xA93E;
  107. pascal void HiliteMenu(short menuID)
  108.     = 0xA938;
  109. pascal void SetItem(MenuHandle theMenu,short item,const Str255 itemString)
  110.     = 0xA947;
  111. pascal void GetItem(MenuHandle theMenu,short item,Str255 itemString)
  112.     = 0xA946;
  113. pascal void DisableItem(MenuHandle theMenu,short item)
  114.     = 0xA93A;
  115. pascal void EnableItem(MenuHandle theMenu,short item)
  116.     = 0xA939;
  117. pascal void CheckItem(MenuHandle theMenu,short item,Boolean checked)
  118.     = 0xA945;
  119. pascal void SetItemMark(MenuHandle theMenu,short item,short markChar)
  120.     = 0xA944;
  121. pascal void GetItemMark(MenuHandle theMenu,short item,short *markChar)
  122.     = 0xA943;
  123. pascal void SetItemIcon(MenuHandle theMenu,short item,short icon)
  124.     = 0xA940;
  125. pascal void GetItemIcon(MenuHandle theMenu,short item,short *iconNum)
  126.     = 0xA93F;
  127. pascal void SetItemStyle(MenuHandle theMenu,short item,short chStyle)
  128.     = 0xA942;
  129. pascal void GetItemStyle(MenuHandle theMenu,short item,Style *chStyle); 
  130. pascal void CalcMenuSize(MenuHandle theMenu)
  131.     = 0xA948;
  132. pascal short CountMItems(MenuHandle theMenu)
  133.     = 0xA950;
  134. pascal MenuHandle GetMHandle(short menuID)
  135.     = 0xA949;
  136. pascal void FlashMenuBar(short menuID)
  137.     = 0xA94C;
  138. pascal void SetMenuFlash(short count)
  139.     = 0xA94A;
  140. pascal long MenuSelect(Point startPt)
  141.     = 0xA93D;
  142. pascal void InitProcMenu(short resID)
  143.     = 0xA808;
  144. pascal void GetItemCmd(MenuHandle theMenu,short item,short *cmdChar)
  145.     = 0xA84E;
  146. pascal void SetItemCmd(MenuHandle theMenu,short item,short cmdChar)
  147.     = 0xA84F;
  148. pascal long PopUpMenuSelect(MenuHandle menu,short top,short left,short popUpItem)
  149.     = 0xA80B;
  150. pascal long MenuChoice(void)
  151.     = 0xAA66;
  152. pascal void DelMCEntries(short menuID,short menuItem)
  153.     = 0xAA60;
  154. pascal MCTableHandle GetMCInfo(void)
  155.     = 0xAA61;
  156. pascal void SetMCInfo(MCTableHandle menuCTbl)
  157.     = 0xAA62;
  158. pascal void DispMCInfo(MCTableHandle menuCTbl)
  159.     = 0xAA63;
  160. pascal MCEntryPtr GetMCEntry(short menuID,short menuItem)
  161.     = 0xAA64;
  162. pascal void SetMCEntries(short numEntries,MCTablePtr menuCEntries)
  163.     = 0xAA65;
  164. MenuHandle newmenu(short menuID,char *menuTitle);
  165. void getitem(MenuHandle menu,short item,char *itemString);
  166. void appendmenu(MenuHandle menu,char *data);
  167. void insmenuitem(MenuHandle theMenu,char *itemString,short afterItem);
  168. long menuselect(Point *startPt);
  169. void setitem(MenuHandle menu,short item,char *itemString);
  170. #ifdef __cplusplus
  171. }
  172. #endif
  173.  
  174. #endif
  175.